<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=windows-1250">
    <title></title>
  </head>
  <body>
<?php
	
	if(isset($_FILES["datei"])){
		echo "<table><tr><th>Key</th><th>Value</th></tr>";
		foreach($_FILES["datei"] AS $key=>$value){
			echo "<tr><td>$key</td><td>$value</td></tr>";
		}
		echo "</table><hr />";
		
		if(move_uploaded_file($_FILES["datei"]["tmp_name"], "upload/uploaded.txt")){
			echo "Dateiupload geht";
		} else {
			echo "Geht nicht";
		}
		
		echo "<pre>";
		
		$inhalt = @file_get_contents("upload/uploaded.txt");
		if($inhalt === false){
			echo "Datei konnte nicht geladen werden";
		} else {
			echo "Inhalt:<br />$inhalt";
		}
		
		
		echo "</pre><hr />";
	}

?>
	<form action="<?php echo $_SERVER["PHP_SELF"] ?>" method="post" enctype="multipart/form-data">
		<input type="file" name="datei" />
		<input type="submit" />
	</form>

  </body>
</html>